package com.ushine.web.base.model.system;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ushine.web.base.model.base.BaseTreeBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Author: yls
 * @Date: 2022/02/28 16:26
 * @Description: 组织架构
 * @Version 1.0
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@ApiModel(description = "组织架构表")
@Table(name = "t_system_org")
@org.hibernate.annotations.Table(appliesTo = "t_system_org", comment = "组织架构表")
@TableName(value = "t_system_org")
public class OrgDO extends BaseTreeBO implements Serializable {

    /**
     * 编号
     * // 解决前台js接收雪花id精度丢失问题
     * JsonFormat(shape = JsonFormat.Shape.STRING)
     */
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty("编号")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Column(name = "id", columnDefinition = "bigint comment '编号'")
    private Long id;


    /**
     * 组织名称
     */
    @ApiModelProperty("组织名称")
    @Column(name = "org_name", columnDefinition = "varchar(255) comment '组织名称'")
    private String orgName;

    /**
     * 组织代码
     */
    @ApiModelProperty("组织代码")
    @Column(name = "org_code", columnDefinition = "varchar(32) comment '组织代码'")
    private String orgCode;

}
